<template>
  <div>
    <div class="Logout">
      <Logout>退出</Logout>
    </div>
    <h1>查询家族成员关系</h1>
    <el-form>
      <el-button @click="count" type="success" icon="el-icon-search">点击查询关系</el-button>
    </el-form>
    <el-table  v-if="tableData"
               :data="tableData"
               border
               style="width: 100%">
      <template slot="empty" >
        <span style="font-size: 20px"></span>
      </template>
      <el-table-column
        prop="cno"
        label="关系编号"
        width="120">
      </el-table-column>
      <el-table-column
        prop="cname"
        label="关系名字"
        width="120">
      </el-table-column>
      <el-table-column
        prop="cmother"
        label="出生时间"
        width="120">
      </el-table-column>
     
      <!-- <el-table-column
        prop="ccycle"
        label="课程周期"
        width="120">
      </el-table-column> -->
    
      <el-table-column
        prop="camount"
        label="人物1"
        width="120">
      </el-table-column>
     
      <el-table-column
        prop="cdaughter"
        label="女儿"
        width="120">
      </el-table-column>

      
        <el-table-column
        prop="cson"
        label="儿子"
        width="120">
      </el-table-column>
  
    
      <!-- <el-table-column
        prop="tno"
        label="存在编号"
        width="120">
      </el-table-column> -->
    
    
      <el-table-column
        prop="cneed"
        label="祖母"
        width="120">
      </el-table-column>
     
     
      <el-table-column
        prop="cjoin"
        label="祖父"
        width="120">
      </el-table-column>
    
       <el-table-column
        prop="cfather"
        label="父亲"
        width="120">
      </el-table-column>

      
       <el-table-column
        prop="ckind"
        label="关系类型"
        width="120">
      </el-table-column>
  
  
  
  
  
    </el-table>
  </div>
</template>

<script>
import Logout from "./Logout";
export default {
  name: "ShowRelation",
  components:{Logout},
  created() {
    let  _this = this;
    console.log("即将打印全体课程")
    this.$axios.post(`/ShowRelation`).then((res) => {
      console.log(res.data);
      this.tableData = res.data;
      this.sta = true
      console.log("全部数据：", this.tableData)
    })
  },



  methods:{
    count() {
      this.$axios.post(`/CountRelation`).then((res) => {
        console.log(res.data);
        this.counts = res.data;
        console.log("课程数量：", this.counts);
        if (res.data.msg=="返回课程数量成功") {
          alert("课程数量：" + res.data.data)
        }
      })
    }
  },

  data () {
    return {
      user:{
        cno:'',
        cname:'',
        cmother:'',
        ccycle:'',
        camount:'',
        cdaughter:'',
        tno:'',
        cneed:'',
        cjoin:'',
        cfather:'',
        cson:'',
        ckind:'',



      },
      sta:false,
      search_tno:'',
      tableData: null,
      counts:'',
    }
  }
}
</script>

<style scoped>

</style>
